/**
 * 用户管理js
 */

$(function () {
	initialPage();
	getGrid();
});

function initialPage() {
	$(window).resize(function() {
		$('#dataGrid').bootstrapTable('resetView', {height: $(window).height()-54});
	});
}

function getGrid() {
	$('#dataGrid').bootstrapTableEx({
		url: '../../servicedata/exhibition/list?_' + $.now(),
		height: $(window).height()-54,
		queryParams: function(params){
			 
			params.exhibitionAreaId = vm.exhibitionAreaNo;
		 
			return params;
		},
		
		columns : [ {
			checkbox : true
		}, {
			field : "exhibitionId",
			title : "展项ID",
			width : "50px"
		}, {
			field : "exhibitionAreaId",
			title : "展区ID",
			width : "60px"
		}, {
			field : "exhibitionName",
			title : "展项名称",
			width : "200px"
		}, {
			field : "exhibitionState",
			title : "展项状态",
			width : "60px"
		}, {
			field : "exhibitionType",
			title : "展项类型",
			width : "60px",

		}, {
			field : "exhibitionNote",
			title : "备注",
			width : "200px",

		}, {
			field : 'operate',
			title : '操作',
			align : 'center',
			width : 100,
			 events: exhibitionoperateEvents,
	            formatter: exhibitionoperateFormatter
		} ]
		
		
           
        
	})
}

var vm = new Vue({
	el:'#dpLTE',
	data: {
		keyword: null ,
		exhibitionAreaNo:null,
		exhibitionHallId:null
	},
	methods : {
		load: function() {
	 
			$('#dataGrid').bootstrapTable('refresh');
		},
		save: function() {
			dialogOpen({
				title: '增加展区展项关联',
				url: 'base/exhibitionhall/choiceExhibition.html?_' + $.now(),
				width: '800px',
				height: '350px',
				scroll : true,
				success: function(iframeId){
				        
						top.frames[iframeId].vm.exhibitionhall.exhibitionHallId = vm.exhibitionHallId;
						top.frames[iframeId].vm.exhibitionhall.exhibitionAreaNo = vm.exhibitionAreaNo;
						top.frames[iframeId].vm.exhibition.exhibitionAreaId = vm.exhibitionAreaNo;
						top.frames[iframeId].vm.setForm();
						 
					},
					yes : function(iframeId) {
						top.frames[iframeId].vm.acceptClick();
					}
				 ,
			});
		} 
	}
})